package com.material.factory.service.impl;

import java.util.List;
import com.material.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.material.factory.mapper.FactoryCategoryMapper;
import com.material.factory.domain.FactoryCategory;
import com.material.factory.service.IFactoryCategoryService;

/**
 * 工厂类别Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-05-07
 */
@Service
public class FactoryCategoryServiceImpl implements IFactoryCategoryService 
{
    @Autowired
    private FactoryCategoryMapper factoryCategoryMapper;

    /**
     * 查询工厂类别
     * 
     * @param id 工厂类别主键
     * @return 工厂类别
     */
    @Override
    public FactoryCategory selectFactoryCategoryById(Long id)
    {
        return factoryCategoryMapper.selectFactoryCategoryById(id);
    }

    /**
     * 查询工厂类别列表
     * 
     * @param factoryCategory 工厂类别
     * @return 工厂类别
     */
    @Override
    public List<FactoryCategory> selectFactoryCategoryList(FactoryCategory factoryCategory)
    {
        return factoryCategoryMapper.selectFactoryCategoryList(factoryCategory);
    }

    /**
     * 新增工厂类别
     * 
     * @param factoryCategory 工厂类别
     * @return 结果
     */
    @Override
    public int insertFactoryCategory(FactoryCategory factoryCategory)
    {
        factoryCategory.setCreateTime(DateUtils.getNowDate());
        return factoryCategoryMapper.insertFactoryCategory(factoryCategory);
    }

    /**
     * 修改工厂类别
     * 
     * @param factoryCategory 工厂类别
     * @return 结果
     */
    @Override
    public int updateFactoryCategory(FactoryCategory factoryCategory)
    {
        return factoryCategoryMapper.updateFactoryCategory(factoryCategory);
    }

    /**
     * 批量删除工厂类别
     * 
     * @param ids 需要删除的工厂类别主键
     * @return 结果
     */
    @Override
    public int deleteFactoryCategoryByIds(Long[] ids)
    {
        return factoryCategoryMapper.deleteFactoryCategoryByIds(ids);
    }

    /**
     * 删除工厂类别信息
     * 
     * @param id 工厂类别主键
     * @return 结果
     */
    @Override
    public int deleteFactoryCategoryById(Long id)
    {
        return factoryCategoryMapper.deleteFactoryCategoryById(id);
    }
}
